/*****************************************************************************
* Keppe Messenger Bots (KMSB)
* Copyright (C) 2014 Keppe Project-Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/

#ifndef MTASERVERCLIENT_H
#define MTASERVERCLIENT_H

#include <QMap>
#include <QList>
#include <QThread>
#include <QProcess>
#include <KMsgFw11Q>

class mtaServerClient : public QThread
{
    Q_OBJECT
public:
    mtaServerClient();

private:
    void objectIncomed(QString object);
    void startMTAServer(QString username, QString script);
    void stopMTAServer(QString username, QString script);
    void resetMTAServer(QString username, QString script);
    KMsgFw11Q *fw;
    QMap<QProcess*,QString> processLinkName;
    QStringList toSend;
    QString bashpath;
    QString sudopath;
    QString sudopassword;
    bool useSudo;

private slots:
    void login();
    void readed();
    void stopped(int ret);

protected:
    void run();
};

#endif // MTASERVERCLIENT_H
